home *** CD-ROM | disk | FTP | other *** search
- unit DeskProp;
-
- interface
-
- uses SysUtils, Windows, Messages, Classes, Graphics, Controls, StdCtrls,
- ExtCtrls, Forms, ComServ, ComObj, StdVcl, AxCtrls, GIFImage, Dialogs,
- ExpBtn, Buttons;
-
- type
- TDesktopProp = class(TPropertyPage)
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Bevel1: TBevel;
- Label4: TLabel;
- ColorDialog1: TColorDialog;
- ForeColor: TBitBtn;
- BackColor: TBitBtn;
- procedure ForeColorClick(Sender: TObject);
- private
- { Private declarations }
- protected
- procedure UpdatePropertyPage; override;
- procedure UpdateObject; override;
- public
- { Public declarations }
- end;
-
- const
- Class_DesktopProp: TGUID = '{C5B5EEE1-E9A7-11D1-8CDD-8D1116120B0F}';
-
- implementation
-
- {$R *.DFM}
-
- procedure TDesktopProp.UpdatePropertyPage;
- begin
- { Update your controls from OleObject }
- ForeColor.Font.Color := OleObject.TextColor;
- BackColor.Font.Color := OleObject.TextBackgroundColor;
- end;
-
- procedure TDesktopProp.UpdateObject;
- begin
- { Update OleObject from your controls }
- OleObject.TextColor := ForeColor.Font.Color;
- OleObject.TextBackgroundColor := BackColor.Font.Color;
- end;
-
- procedure TDesktopProp.ForeColorClick(Sender: TObject);
- begin
- with Sender as TBitBtn do begin
- ColorDialog1.Color := Font.Color;
- if ColorDialog1.Execute then begin
- Modified;
- Font.Color := ColorDialog1.Color;
- end;
- end;
- end;
-
- initialization
- TActiveXPropertyPageFactory.Create(
- ComServer,
- TDesktopProp,
- Class_DesktopProp);
- end.
-
-